#pragma once
#ifndef _NET_INCLUDE_H_
#define _NET_INCLUDE_H_

#include "net_addr.h"
#include <functional>
#include <memory>


#ifdef _WIN32
typedef SOCKET socket_fd;
#define SOCKET_ERR_FD INVALID_SOCKET
#else
typedef int socket_fd;
#define SOCKET_ERR_FD -1
#endif

class ByteBuffer;
namespace as
{
namespace inet
{
class AsSession;
enum class io_state
    {
        NONE = 0,
        RUNNING = 1,
        STOP = 2,
        STOP_OK = 3,
    };
}
}


typedef std::function<void(std::shared_ptr<as::inet::AsSession>)> new_conn_cb;
typedef std::function<void(std::shared_ptr<as::inet::AsSession>)> connect_cb;
typedef std::function<void(std::shared_ptr<as::inet::AsSession>)> close_cb;
typedef std::function<void(std::shared_ptr<as::inet::AsSession>, int)> write_cb;
typedef std::function<void(std::shared_ptr<as::inet::AsSession>, char*, int)> recv_cb;



#endif